#pragma once
#include <cstdint>
#include <list>

namespace utils
{
  template <typename O>
  uint64_t hashCodeList(std::shared_ptr<std::list<O*>> list)
  {
    uint64_t v = 0;
    for (auto ele: *list) {
      v |= dynamic_cast<Object* >(ele)->hashCode();
    }
    return v;
  }
  
  template <typename O>
  uint64_t hashCodeList(std::shared_ptr<std::list<std::shared_ptr<O>>> list)
  {
    uint64_t v = 0;
    for (auto ele: *list) {
      v |= std::dynamic_pointer_cast<Object>(ele)->hashCode();
    }
    return v;
  }
};
